//#include<iostream>
//#include<string>

#include"Log.hpp"
//#include"threadpool.hpp"
#include"threadpool_singleton.hpp"
using namespace LogMod;
using namespace Mythreadpool;

void work()
{
    LOG(level::DEBUG)<<pthread_self()<<" get a task: ";
    //LOG(level::DEBUG)<<"finish work";
}

int main()
{
    Be_Log_Screen();
    threadpool<task_t>::GetInstance()->Start();
    threadpool<task_t>::GetInstance()->Enqueue(work);
    threadpool<task_t>::GetInstance()->Enqueue(work);
    threadpool<task_t>::GetInstance()->Enqueue(work);
    threadpool<task_t>::GetInstance()->Stop();
    threadpool<task_t>::GetInstance()->Enqueue(work);
    threadpool<task_t>::GetInstance()->Join();
    return 0;
}


// int main()
// {
//     Be_Log_Screen();
//     //LOG(level::INFO)<<"Init success"<<31.145;
//     threadpool<task_t> tp;
//     tp.Start();
//     tp.Enqueue(work);
//     tp.Enqueue(work);
//     tp.Enqueue(work);
//     tp.Enqueue(work);
//     tp.Enqueue(work);
//     tp.Enqueue(work);
//     tp.Enqueue(work);
//     tp.Stop();
//     tp.Join();
//     return 0;
// }

    //tp.Enqueue(100);
    // for(int i = 0;i < 20;i++)
    // {
    //     tp.Enqueue(i);
    // }



// int main(){
//     //log(level::DEBUG,"main.cc",7);
//     //LOG(level::INFO);
//     Be_Log_file();
//     LOG(level::INFO)<<"hello ";
//     LOG(level::INFO)<<"hello ";
//     LOG(level::INFO)<<"hello ";
//     LOG(level::INFO)<<"hello ";

// }


/*
int main()
{
    std::string str = "hello world";
//    std::cout<<str<<std::endl;
    
}
*/